﻿/*!
* qTip2 - Pretty powerful tooltips
* http://craigsworks.com/projects/qtip2/
*
* Version: nightly
* Copyright 2009-2010 Craig Michael Thompson - http://craigsworks.com
*
* Dual licensed under MIT or GPLv2 licenses
*   http://en.wikipedia.org/wiki/MIT_License
*   http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Tue Jul  3 15:45:43.0000000000 2012
*/
/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true *//*global window: false, jQuery: false, console: false, define: false */(function (a) { typeof define === "function" && define.amd ? define(["jquery"], a) : a(jQuery) })(function (a) { function P(b) { var c = this, d = b.elements, e = d.tooltip, f = ".bgiframe-" + b.id; a.extend(c, { init: function () { d.bgiframe = a('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';"  style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>'), d.bgiframe.appendTo(e), e.bind("tooltipmove" + f, c.adjust) }, adjust: function () { var a = b.get("dimensions"), c = b.plugins.tip, f = d.tip, g, h; h = parseInt(e.css("border-left-width"), 10) || 0, h = { left: -h, top: -h }, c && f && (g = c.corner.precedance === "x" ? ["width", "left"] : ["height", "top"], h[g[1]] -= f[g[0]]()), d.bgiframe.css(h).css(a) }, destroy: function () { d.bgiframe.remove(), e.unbind(f) } }), c.init() } function O(d) { function t(b) { var d = a(b.target), e = d.closest(".qtip"), f; f = e.length < 1 ? c : parseInt(e[0].style.zIndex, 10) > parseInt(h[0].style.zIndex, 10), !f && a(b.target).closest(y)[0] !== h[0] && r(d) } function r(a) { o.length < 1 && a.length ? a.not("body").blur() : o.first().focus() } function q() { o = a(n, h).not("[disabled]").map(function () { return typeof this.focus === "function" ? this : null }) } var e = this, f = d.options.show.modal, g = d.elements, h = g.tooltip, i = "#qtip-overlay", j = ".qtipmodal", k = j + d.id, l = "is-modal-qtip", m = a(document.body), n = s.modal.focusable.join(","), o = {}, p; d.checks.modal = { "^show.modal.(on|blur)$": function () { e.init(), g.overlay.toggle(h.is(":visible")) }, "^content.text$": q }, a.extend(e, { init: function () { if (!f.on) return e; p = e.create(), h.attr(l, b).css("z-index", s.modal.zindex + a(y + "[" + l + "]").length).unbind(j).unbind(k).bind("tooltipshow" + j + " tooltiphide" + j, function (b, c, d) { var f = b.originalEvent; if (b.target === h[0]) if (f && b.type === "tooltiphide" && /mouse(leave|enter)/.test(f.type) && a(f.relatedTarget).closest(p[0]).length) try { b.preventDefault() } catch (g) { } else (!f || f && !f.solo) && e[b.type.replace("tooltip", "")](b, d) }).bind("tooltipfocus" + j, function (b) { if (!b.isDefaultPrevented() && b.target === h[0]) { var c = a(y).filter("[" + l + "]"), d = s.modal.zindex + c.length, e = parseInt(h[0].style.zIndex, 10); p[0].style.zIndex = d - 2, c.each(function () { this.style.zIndex > e && (this.style.zIndex -= 1) }), c.end().filter("." + A).qtip("blur", b.originalEvent), h.addClass(A)[0].style.zIndex = d; try { b.preventDefault() } catch (f) { } } }).bind("tooltiphide" + j, function (b) { b.target === h[0] && a("[" + l + "]").filter(":visible").not(h).last().qtip("focus", b) }), f.escape && a(document).unbind(k).bind("keydown" + k, function (a) { a.keyCode === 27 && h.hasClass(A) && d.hide(a) }), f.blur && g.overlay.unbind(k).bind("click" + k, function (a) { h.hasClass(A) && d.hide(a) }), q(); return e }, create: function () { function d() { p.css({ height: a(window).height(), width: a(window).width() }) } var b = a(i); if (b.length) return g.overlay = b.insertAfter(a(y).last()); p = g.overlay = a("<div />", { id: i.substr(1), html: "<div></div>", mousedown: function () { return c } }).hide().insertAfter(a(y).last()), a(window).unbind(j).bind("resize" + j, d), d(); return p }, toggle: function (d, g, i) { if (d && d.isDefaultPrevented()) return e; var j = f.effect, n = g ? "show" : "hide", o = p.is(":visible"), q = a("[" + l + "]").filter(":visible").not(h), s; p || (p = e.create()); if (p.is(":animated") && o === g || !g && q.length) return e; g ? (p.css({ left: 0, top: 0 }), p.toggleClass("blurs", f.blur), f.stealfocus !== c && (m.bind("focusin" + k, t), r(a("body *")))) : m.unbind("focusin" + k), p.stop(b, c), a.isFunction(j) ? j.call(p, g) : j === c ? p[n]() : p.fadeTo(parseInt(i, 10) || 90, g ? 1 : 0, function () { g || a(this).hide() }), g || p.queue(function (a) { p.css({ left: "", top: "" }), a() }); return e }, show: function (a, c) { return e.toggle(a, b, c) }, hide: function (a, b) { return e.toggle(a, c, b) }, destroy: function () { var b = p; b && (b = a("[" + l + "]").not(h).length < 1, b ? (g.overlay.remove(), a(document).unbind(j)) : g.overlay.unbind(j + d.id), m.undelegate("*", "focusin" + k)); return h.removeAttr(l).unbind(j) } }), e.init() } function N(o, p) { function I(a) { var b = a.precedance === g, c = x[b ? h : i], d = x[b ? i : h], e = a.string().indexOf(n) > -1, f = c * (e ? .5 : 1), j = Math.pow, k = Math.round, l, m, o, p = Math.sqrt(j(f, 2) + j(d, 2)), q = [z / f * p, z / d * p]; q[2] = Math.sqrt(j(q[0], 2) - j(z, 2)), q[3] = Math.sqrt(j(q[1], 2) - j(z, 2)), l = p + q[2] + q[3] + (e ? 0 : q[0]), m = l / p, o = [k(m * d), k(m * c)]; return { height: o[b ? 0 : 1], width: o[b ? 1 : 0]} } function H(b) { var c = u.titlebar && b.y === j, d = c ? u.titlebar : u.content, e = a.browser.mozilla, f = e ? "-moz-" : a.browser.webkit ? "-webkit-" : "", g = b.y + (e ? "" : "-") + b.x, h = f + (e ? "border-radius-" + g : "border-" + g + "-radius"); return parseInt(d.css(h), 10) || parseInt(v.css(h), 10) || 0 } function G(a, b, c) { b = b ? b : a[a.precedance]; var d = v.hasClass(C), e = u.titlebar && a.y === j, f = e ? u.titlebar : u.tooltip, g = "border-" + b + "-width", h; v.addClass(C), h = parseInt(f.css(g), 10), h = (c ? h || parseInt(v.css(g), 10) : h) || 0, v.toggleClass(C, d); return h } function F(a, d, h, i) { if (u.tip) { var p = r.corner.clone(), s = h.adjusted, v = o.options.position.adjust.method.split(" "), x = v[0], y = v[1] || v[0], z = { left: c, top: c, x: 0, y: 0 }, A, B = {}, C; r.corner.fixed !== b && (x === q && p.precedance === f && s.left && p.y !== n ? p.precedance = p.precedance === f ? g : f : x !== q && s.left && (p.x = p.x === n ? s.left > 0 ? k : m : p.x === k ? m : k), y === q && p.precedance === g && s.top && p.x !== n ? p.precedance = p.precedance === g ? f : g : y !== q && s.top && (p.y = p.y === n ? s.top > 0 ? j : l : p.y === j ? l : j), p.string() !== w.corner.string() && (w.top !== s.top || w.left !== s.left) && r.update(p, c)), A = r.position(p, s), A[p.x] += G(p, p.x, b), A[p.y] += G(p, p.y, b), A.right !== e && (A.left = -A.right), A.bottom !== e && (A.top = -A.bottom), A.user = Math.max(0, t.offset); if (z.left = x === q && !!s.left) p.x === n ? B["margin-left"] = z.x = A["margin-left"] - s.left : (C = A.right !== e ? [s.left, -A.left] : [-s.left, A.left], (z.x = Math.max(C[0], C[1])) > C[0] && (h.left -= s.left, z.left = c), B[A.right !== e ? m : k] = z.x); if (z.top = y === q && !!s.top) p.y === n ? B["margin-top"] = z.y = A["margin-top"] - s.top : (C = A.bottom !== e ? [s.top, -A.top] : [-s.top, A.top], (z.y = Math.max(C[0], C[1])) > C[0] && (h.top -= s.top, z.top = c), B[A.bottom !== e ? l : j] = z.y); u.tip.css(B).toggle(!(z.x && z.y || p.x === n && z.y || p.y === n && z.x)), h.left -= A.left.charAt ? A.user : x !== q || z.top || !z.left && !z.top ? A.left : 0, h.top -= A.top.charAt ? A.user : y !== q || z.left || !z.left && !z.top ? A.top : 0, w.left = s.left, w.top = s.top, w.corner = p.clone() } } function E() { x.width = t.width, x.height = t.height } function D() { x.width = t.height, x.height = t.width } var r = this, t = o.options.style.tip, u = o.elements, v = u.tooltip, w = { top: 0, left: 0 }, x = { width: t.width, height: t.height }, y = {}, z = t.border || 0, A = ".qtip-tip", B = !!(a("<canvas />")[0] || {}).getContext; r.mimic = r.corner = d, r.border = z, r.offset = t.offset, r.size = x, o.checks.tip = { "^position.my|style.tip.(corner|mimic|border)$": function () { r.init() || r.destroy(), o.reposition() }, "^style.tip.(height|width)$": function () { x = { width: t.width, height: t.height }, r.create(), r.update(), o.reposition() }, "^content.title.text|style.(classes|widget)$": function () { u.tip && u.tip.length && r.update() } }, a.extend(r, { init: function () { var b = r.detectCorner() && (B || a.browser.msie); b && (r.create(), r.update(), v.unbind(A).bind("tooltipmove" + A, F)); return b }, detectCorner: function () { var a = t.corner, d = o.options.position, e = d.at, f = d.my.string ? d.my.string() : d.my; if (a === c || f === c && e === c) return c; a === b ? r.corner = new s.Corner(f) : a.string || (r.corner = new s.Corner(a), r.corner.fixed = b), w.corner = new s.Corner(r.corner.string()); return r.corner.string() !== "centercenter" }, detectColours: function (b) { var c, d, e, f = u.tip.css("cssText", ""), g = b || r.corner, h = g[g.precedance], i = "border-" + h + "-color", k = "border" + h.charAt(0) + h.substr(1) + "Color", l = /rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i, m = "background-color", o = "transparent", p = " !important", q = u.titlebar && (g.y === j || g.y === n && f.position().top + x.height / 2 + t.offset < u.titlebar.outerHeight(1)), s = q ? u.titlebar : u.tooltip; v.addClass(C), y.fill = d = f.css(m), y.border = e = f[0].style[k] || f.css(i) || v.css(i); if (!d || l.test(d)) y.fill = s.css(m) || o, l.test(y.fill) && (y.fill = v.css(m) || d); if (!e || l.test(e) || e === a(document.body).css("color")) { y.border = s.css(i) || o; if (l.test(y.border) || y.border === s.css("color")) y.border = v.css(i) || v.css(k) || e } a("*", f).add(f).css("cssText", m + ":" + o + p + ";border:0" + p + ";"), v.removeClass(C) }, create: function () { var b = x.width, c = x.height, d; u.tip && u.tip.remove(), u.tip = a("<div />", { "class": "ui-tooltip-tip" }).css({ width: b, height: c }).prependTo(v), B ? a("<canvas />").appendTo(u.tip)[0].getContext("2d").save() : (d = '<vml:shape coordorigin="0,0" style="display:inline-block; position:absolute; behavior:url(#default#VML);"></vml:shape>', u.tip.html(d + d), a("*", u.tip).bind("click mousedown", function (a) { a.stopPropagation() })) }, update: function (e, h) { var i = u.tip, o = i.children(), p = x.width, q = x.height, A = "px solid ", C = "px dashed transparent", F = t.mimic, H = Math.round, J, K, L, N, O; e || (e = w.corner || r.corner), F === c ? F = e : (F = new s.Corner(F), F.precedance = e.precedance, F.x === "inherit" ? F.x = e.x : F.y === "inherit" ? F.y = e.y : F.x === F.y && (F[e.precedance] = e[e.precedance])), J = F.precedance, e.precedance === f ? D() : E(), u.tip.css({ width: p = x.width, height: q = x.height }), r.detectColours(e), y.border !== "transparent" ? (z = G(e, d, b), t.border === 0 && z > 0 && (y.fill = y.border), r.border = z = t.border !== b ? t.border : z) : r.border = z = 0, L = M(F, p, q), r.size = O = I(e), i.css(O), e.precedance === g ? N = [H(F.x === k ? z : F.x === m ? O.width - p - z : (O.width - p) / 2), H(F.y === j ? O.height - q : 0)] : N = [H(F.x === k ? O.width - p : 0), H(F.y === j ? z : F.y === l ? O.height - q - z : (O.height - q) / 2)], B ? (o.attr(O), K = o[0].getContext("2d"), K.restore(), K.save(), K.clearRect(0, 0, 3e3, 3e3), K.fillStyle = y.fill, K.strokeStyle = y.border, K.lineWidth = z * 2, K.lineJoin = "miter", K.miterLimit = 100, K.translate(N[0], N[1]), K.beginPath(), K.moveTo(L[0][0], L[0][1]), K.lineTo(L[1][0], L[1][1]), K.lineTo(L[2][0], L[2][1]), K.closePath(), z && (v.css("background-clip") === "border-box" && (K.strokeStyle = y.fill, K.stroke()), K.strokeStyle = y.border, K.stroke()), K.fill()) : (L = "m" + L[0][0] + "," + L[0][1] + " l" + L[1][0] + "," + L[1][1] + " " + L[2][0] + "," + L[2][1] + " xe", N[2] = z && /^(r|b)/i.test(e.string()) ? parseFloat(a.browser.version, 10) === 8 ? 2 : 1 : 0, o.css({ antialias: "" + (F.string().indexOf(n) > -1), left: N[0] - N[2] * Number(J === f), top: N[1] - N[2] * Number(J === g), width: p + z, height: q + z }).each(function (b) { var c = a(this); c[c.prop ? "prop" : "attr"]({ coordsize: p + z + " " + (q + z), path: L, fillcolor: y.fill, filled: !!b, stroked: !b }).css({ display: z || b ? "block" : "none" }), !b && c.html() === "" && c.html('<vml:stroke weight="' + z * 2 + 'px" color="' + y.border + '" miterlimit="1000" joinstyle="miter"  style="behavior:url(#default#VML); display:inline-block;" />') })), h !== c && r.position(e) }, position: function (b) { var d = u.tip, e = {}, l = Math.max(0, t.offset), m, o, p; if (t.corner === c || !d) return c; b = b || r.corner, m = b.precedance, o = I(b), p = [b.x, b.y], m === f && p.reverse(), a.each(p, function (a, c) { var d, f; c === n ? (d = m === g ? k : j, e[d] = "50%", e["margin-" + d] = -Math.round(o[m === g ? h : i] / 2) + l) : (d = G(b, c), f = H(b), e[c] = a ? 0 : l + (f > d ? f : -d)) }), e[b[m]] -= o[m === f ? h : i], d.css({ top: "", bottom: "", left: "", right: "", margin: "" }).css(e); return e }, destroy: function () { u.tip && u.tip.remove(), u.tip = !1, v.unbind(A) } }), r.init() } function M(a, b, c) { var d = Math.ceil(b / 2), e = Math.ceil(c / 2), f = { bottomright: [[0, 0], [b, c], [b, 0]], bottomleft: [[0, 0], [b, 0], [0, c]], topright: [[0, c], [b, 0], [b, c]], topleft: [[0, 0], [0, c], [b, c]], topcenter: [[0, c], [d, 0], [b, c]], bottomcenter: [[0, 0], [b, 0], [d, c]], rightcenter: [[0, 0], [b, e], [0, c]], leftcenter: [[b, 0], [b, c], [0, e]] }; f.lefttop = f.bottomright, f.righttop = f.bottomleft, f.leftbottom = f.topright, f.rightbottom = f.topleft; return f[a.string()] } function L(d) { var e = this, f = d.elements.tooltip, g = d.options.content.ajax, h = r.defaults.content.ajax, i = ".qtip-ajax", j = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, k = b, l = c, m; d.checks.ajax = { "^content.ajax": function (a, b, c) { b === "ajax" && (g = c), b === "once" ? e.init() : g && g.url ? e.load() : f.unbind(i) } }, a.extend(e, { init: function () { g && g.url && f.unbind(i)[g.once ? "one" : "bind"]("tooltipshow" + i, e.load); return e }, load: function (f) { function t(a, b, c) { !d.destroyed && a.status !== 0 && d.set("content.text", b + ": " + c) } function s(b, c, e) { var f; d.destroyed || (o && (b = a("<div/>").append(b.replace(j, "")).find(o)), (f = h.success || g.success) && a.isFunction(f) ? f.call(g.context || d, b, c, e) : d.set("content.text", b)) } function r() { var e; d.destroyed || (k = c, p && (l = b, d.show(f.originalEvent)), (e = h.complete || g.complete) && a.isFunction(e) && e.apply(g.context || d, arguments)) } if (l) l = c; else { var i = g.url.indexOf(" "), n = g.url, o, p = !g.loading && k; if (p) try { f.preventDefault() } catch (q) { } else if (f && f.isDefaultPrevented()) return e; m && m.abort && m.abort(), i > -1 && (o = n.substr(i), n = n.substr(0, i)), m = a.ajax(a.extend({ error: h.error || t, context: d }, g, { url: n, success: s, complete: r })) } }, destroy: function () { m && m.abort && m.abort(), d.destroyed = b } }), e.init() } function K(e, f) { var g, h, i, j, k, l = a(this), m = a(document.body), n = this === document ? m : l, o = l.metadata ? l.metadata(f.metadata) : d, p = f.metadata.type === "html5" && o ? o[f.metadata.name] : d, q = l.data(f.metadata.name || "qtipopts"); try { q = typeof q === "string" ? (new Function("return " + q))() : q } catch (t) { H("Unable to parse HTML5 attribute data: " + q) } j = a.extend(b, {}, r.defaults, f, typeof q === "object" ? I(q) : d, I(p || o)), h = j.position, j.id = e; if ("boolean" === typeof j.content.text) { i = l.attr(j.content.attr); if (j.content.attr !== c && i) j.content.text = i; else { H("Unable to locate content for tooltip! Aborting render of tooltip on element: ", l); return c } } h.container.length || (h.container = m), h.target === c && (h.target = n), j.show.target === c && (j.show.target = n), j.show.solo === b && (j.show.solo = h.container.closest("body")), j.hide.target === c && (j.hide.target = n), j.position.viewport === b && (j.position.viewport = h.container), h.container = h.container.eq(0), h.at = new s.Corner(h.at), h.my = new s.Corner(h.my); if (a.data(this, "qtip")) if (j.overwrite) l.qtip("destroy"); else if (j.overwrite === c) return c; j.suppress && (k = a.attr(this, "title")) && a(this).removeAttr("title").attr(F, k).attr("title", ""), g = new J(l, j, e, !!i), a.data(this, "qtip", g), l.bind("remove.qtip-" + e + " removeqtip.qtip-" + e, function () { g.destroy() }); return g } function J(f, g, o, p) { function X() { var b = [g.show.target[0], g.hide.target[0], q.rendered && M.tooltip[0], g.position.container[0], g.position.viewport[0], window, document]; q.rendered ? a([]).pushStack(a.grep(b, function (a) { return typeof a === "object" })).unbind(L) : g.show.target.unbind(L + "-create") } function W() { function m(a) { q.rendered && K[0].offsetWidth > 0 && q.reposition(a) } function l(a) { if (K.hasClass(x)) return c; clearTimeout(q.timers.inactive), q.timers.inactive = setTimeout(function () { q.hide(a) }, g.hide.inactive) } function k(b) { if (K.hasClass(x) || H || J) return c; var f = a(b.relatedTarget || b.target), h = f.closest(y)[0] === K[0], i = f[0] === e.show[0]; clearTimeout(q.timers.show), clearTimeout(q.timers.hide); if (d.target === "mouse" && h || g.hide.fixed && (/mouse(out|leave|move)/.test(b.type) && (h || i))) try { b.preventDefault(), b.stopImmediatePropagation() } catch (j) { } else g.hide.delay > 0 ? q.timers.hide = setTimeout(function () { q.hide(b) }, g.hide.delay) : q.hide(b) } function j(a) { if (K.hasClass(x)) return c; clearTimeout(q.timers.show), clearTimeout(q.timers.hide); var d = function () { q.toggle(b, a) }; g.show.delay > 0 ? q.timers.show = setTimeout(d, g.show.delay) : d() } var d = g.position, e = { show: g.show.target, hide: g.hide.target, viewport: a(d.viewport), document: a(document), body: a(document.body), window: a(window) }, h = { show: a.trim("" + g.show.event).split(" "), hide: a.trim("" + g.hide.event).split(" ") }, i = a.browser.msie && parseInt(a.browser.version, 10) === 6; K.bind("mouseenter" + L + " mouseleave" + L, function (a) { var b = a.type === "mouseenter"; b && q.focus(a), K.toggleClass(B, b) }), /mouse(out|leave)/i.test(g.hide.event) && (g.hide.leave === "window" && e.window.bind("mouseleave" + L + " blur" + L, function (a) { !/select|option/.test(a.target.nodeName) && !a.relatedTarget && q.hide(a) })), g.hide.fixed ? (e.hide = e.hide.add(K), K.bind("mouseover" + L, function () { K.hasClass(x) || clearTimeout(q.timers.hide) })) : /mouse(over|enter)/i.test(g.show.event) && e.hide.bind("mouseleave" + L, function (a) { clearTimeout(q.timers.show) }), ("" + g.hide.event).indexOf("unfocus") > -1 && d.container.closest("html").bind("mousedown" + L, function (b) { var c = a(b.target), d = q.rendered && !K.hasClass(x) && K[0].offsetWidth > 0, e = c.parents(y).filter(K[0]).length > 0; c[0] !== f[0] && c[0] !== K[0] && !e && !f.has(c[0]).length && !c.attr("disabled") && q.hide(b) }), "number" === typeof g.hide.inactive && (e.show.bind("qtip-" + o + "-inactive", l), a.each(r.inactiveEvents, function (a, b) { e.hide.add(M.tooltip).bind(b + L + "-inactive", l) })), a.each(h.hide, function (b, c) { var d = a.inArray(c, h.show), f = a(e.hide); d > -1 && f.add(e.show).length === f.length || c === "unfocus" ? (e.show.bind(c + L, function (a) { K[0].offsetWidth > 0 ? k(a) : j(a) }), delete h.show[d]) : e.hide.bind(c + L, k) }), a.each(h.show, function (a, b) { e.show.bind(b + L, j) }), "number" === typeof g.hide.distance && e.show.add(K).bind("mousemove" + L, function (a) { var b = N.origin || {}, c = g.hide.distance, d = Math.abs; (d(a.pageX - b.pageX) >= c || d(a.pageY - b.pageY) >= c) && q.hide(a) }), d.target === "mouse" && (e.show.bind("mousemove" + L, function (a) { t = { pageX: a.pageX, pageY: a.pageY, type: "mousemove"} }), d.adjust.mouse && (g.hide.event && (K.bind("mouseleave" + L, function (a) { (a.relatedTarget || a.target) !== e.show[0] && q.hide(a) }), M.target.bind("mouseenter" + L + " mouseleave" + L, function (a) { N.onTarget = a.type === "mouseenter" })), e.document.bind("mousemove" + L, function (a) { q.rendered && N.onTarget && !K.hasClass(x) && K[0].offsetWidth > 0 && q.reposition(a || t) }))), (d.adjust.resize || e.viewport.length) && (a.event.special.resize ? e.viewport : e.window).bind("resize" + L, m), (e.viewport.length || i && K.css("position") === "fixed") && e.viewport.bind("scroll" + L, m) } function V(b, d) { function h(b) { function i(e) { e && (delete h[e.src], clearTimeout(q.timers.img[e.src]), a(e).unbind(L)), a.isEmptyObject(h) && (q.redraw(), d !== c && q.reposition(N.event), b()) } var f, h = {}; if ((f = g.find("img[src]:not([height]):not([width])")).length === 0) return i(); f.each(function (b, c) { if (h[c.src] === e) { var d = 0, f = 3; (function g() { if (c.height || c.width || d > f) return i(c); d += 1, q.timers.img[c.src] = setTimeout(g, 700) })(), a(c).bind("error" + L + " load" + L, function () { i(this) }), h[c.src] = c } }) } var g = M.content; if (!q.rendered || !b) return c; a.isFunction(b) && (b = b.call(f, N.event, q) || ""), b.jquery && b.length > 0 ? g.empty().append(b.css({ display: "block" })) : g.html(b), q.rendered < 0 ? K.queue("fx", h) : (J = 0, h(a.noop)); return q } function U(b, d) { var e = M.title; if (!q.rendered || !b) return c; a.isFunction(b) && (b = b.call(f, N.event, q)); if (b === c || !b && b !== "") return Q(c); b.jquery && b.length > 0 ? e.empty().append(b.css({ display: "block" })) : e.html(b), q.redraw(), d !== c && q.rendered && K[0].offsetWidth > 0 && q.reposition(N.event) } function T(a) { var b = M.button, d = M.title; if (!q.rendered) return c; a ? (d || S(), R()) : b.remove() } function S() { var c = E + "-title"; M.titlebar && Q(), M.titlebar = a("<div />", { "class": v + "-titlebar " + (g.style.widget ? "ui-widget-header" : "") }).append(M.title = a("<div />", { id: c, "class": v + "-title", "aria-atomic": b })).insertBefore(M.content).delegate(".ui-tooltip-close", "mousedown keydown mouseup keyup mouseout", function (b) { a(this).toggleClass("ui-state-active ui-state-focus", b.type.substr(-4) === "down") }).delegate(".ui-tooltip-close", "mouseover mouseout", function (b) { a(this).toggleClass("ui-state-hover", b.type === "mouseover") }), g.content.title.button ? R() : q.rendered && q.redraw() } function R() { var b = g.content.title.button, d = typeof b === "string", e = d ? b : "Close tooltip"; M.button && M.button.remove(), b.jquery ? M.button = b : M.button = a("<a />", { "class": "ui-state-default ui-tooltip-close " + (g.style.widget ? "" : v + "-icon"), title: e, "aria-label": e }).prepend(a("<span />", { "class": "ui-icon ui-icon-close", html: "&times;" })), M.button.appendTo(M.titlebar).attr("role", "button").click(function (a) { K.hasClass(x) || q.hide(a); return c }), q.redraw() } function Q(a) { M.title && (M.titlebar.remove(), M.titlebar = M.title = M.button = d, a !== c && q.reposition()) } function P() { var a = g.style.widget; K.toggleClass(w, a).toggleClass(z, g.style.def && !a), M.content.toggleClass(w + "-content", a), M.titlebar && M.titlebar.toggleClass(w + "-header", a), M.button && M.button.toggleClass(v + "-icon", !a) } function O(a) { var b = 0, c, d = g, e = a.split("."); while (d = d[e[b++]]) b < e.length && (c = d); return [c || g, e.pop()] } var q = this, D = document.body, E = v + "-" + o, H = 0, J = 0, K = a(), L = ".qtip-" + o, M, N; q.id = o, q.destroyed = q.rendered = c, q.elements = M = { target: f }, q.timers = { img: {} }, q.options = g, q.checks = {}, q.plugins = {}, q.cache = N = { event: {}, target: a(), disabled: c, attr: p, onTarget: c, lastClass: "" }, q.checks.builtin = { "^id$": function (d, e, f) { var g = f === b ? r.nextid : f, h = v + "-" + g; g !== c && g.length > 0 && !a("#" + h).length && (K[0].id = h, M.content[0].id = h + "-content", M.title[0].id = h + "-title") }, "^content.text$": function (a, b, c) { V(c) }, "^content.title.text$": function (a, b, c) { if (!c) return Q(); !M.title && c && S(), U(c) }, "^content.title.button$": function (a, b, c) { T(c) }, "^position.(my|at)$": function (a, b, c) { "string" === typeof c && (a[b] = new s.Corner(c)) }, "^position.container$": function (a, b, c) { q.rendered && K.appendTo(c) }, "^show.ready$": function () { q.rendered ? q.toggle(b) : q.render(1) }, "^style.classes$": function (a, b, c) { K.attr("class", v + " qtip ui-helper-reset " + c) }, "^style.widget|content.title": P, "^events.(render|show|move|hide|focus|blur)$": function (b, c, d) { K[(a.isFunction(d) ? "" : "un") + "bind"]("tooltip" + c, d) }, "^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)": function () { var a = g.position; K.attr("tracking", a.target === "mouse" && a.adjust.mouse), X(), W() } }, a.extend(q, { render: function (d) { if (q.rendered) return q; var e = g.content.text, h = g.content.title.text, i = g.position, j = a.Event("tooltiprender"); a.attr(f[0], "aria-describedby", E), K = M.tooltip = a("<div/>", { id: E, "class": v + " qtip ui-helper-reset " + z + " " + g.style.classes + " " + v + "-pos-" + g.position.my.abbrev(), width: g.style.width || "", height: g.style.height || "", tracking: i.target === "mouse" && i.adjust.mouse, role: "alert", "aria-live": "polite", "aria-atomic": c, "aria-describedby": E + "-content", "aria-hidden": b }).toggleClass(x, N.disabled).data("qtip", q).appendTo(g.position.container).append(M.content = a("<div />", { "class": v + "-content", id: E + "-content", "aria-atomic": b })), q.rendered = -1, H = J = 1, h && (S(), a.isFunction(h) || U(h, c)), a.isFunction(e) || V(e, c), q.rendered = b, P(), a.each(g.events, function (b, c) { a.isFunction(c) && K.bind(b === "toggle" ? "tooltipshow tooltiphide" : "tooltip" + b, c) }), a.each(s, function () { this.initialize === "render" && this(q) }), W(), K.queue("fx", function (a) { j.originalEvent = N.event, K.trigger(j, [q]), H = J = 0, q.redraw(), (g.show.ready || d) && q.toggle(b, N.event, c), a() }); return q }, get: function (a) { var b, c; switch (a.toLowerCase()) { case "dimensions": b = { height: K.outerHeight(), width: K.outerWidth() }; break; case "offset": b = s.offset(K, g.position.container); break; default: c = O(a.toLowerCase()), b = c[0][c[1]], b = b.precedance ? b.string() : b } return b }, set: function (e, f) { function n(a, b) { var c, d, e; for (c in l) for (d in l[c]) if (e = (new RegExp(d, "i")).exec(a)) b.push(e), l[c][d].apply(q, b) } var h = /^position\.(my|at|adjust|target|container)|style|content|show\.ready/i, i = /^content\.(title|attr)|style/i, j = c, k = c, l = q.checks, m; "string" === typeof e ? (m = e, e = {}, e[m] = f) : e = a.extend(b, {}, e), a.each(e, function (b, c) { var d = O(b.toLowerCase()), f; f = d[0][d[1]], d[0][d[1]] = "object" === typeof c && c.nodeType ? a(c) : c, e[b] = [d[0], d[1], c, f], j = h.test(b) || j, k = i.test(b) || k }), I(g), H = J = 1, a.each(e, n), H = J = 0, q.rendered && K[0].offsetWidth > 0 && (j && q.reposition(g.position.target === "mouse" ? d : N.event), k && q.redraw()); return q }, toggle: function (e, f) { function u() { e ? (a.browser.msie && K[0].style.removeAttribute("filter"), K.css("overflow", ""), "string" === typeof i.autofocus && a(i.autofocus, K).focus(), i.target.trigger("qtip-" + o + "-inactive")) : K.css({ display: "", visibility: "", opacity: "", left: "", top: "" }), s = a.Event("tooltip" + (e ? "visible" : "hidden")), s.originalEvent = f ? N.event : d, K.trigger(s, [q]) } if (!q.rendered) return e ? q.render(1) : q; var h = e ? "show" : "hide", i = g[h], j = g[e ? "hide" : "show"], k = g.position, l = g.content, m = K[0].offsetWidth > 0, n = e || i.target.length === 1, p = !f || i.target.length < 2 || N.target[0] === f.target, r, s; (typeof e).search("boolean|number") && (e = !m); if (!K.is(":animated") && m === e && p) return q; if (f) { if (/over|enter/.test(f.type) && /out|leave/.test(N.event.type) && g.show.target.add(f.target).length === g.show.target.length && K.has(f.relatedTarget).length) return q; N.event = a.extend({}, f) } s = a.Event("tooltip" + h), s.originalEvent = f ? N.event : d, K.trigger(s, [q, 90]); if (s.isDefaultPrevented()) return q; a.attr(K[0], "aria-hidden", !e), e ? (N.origin = a.extend({}, t), q.focus(f), a.isFunction(l.text) && V(l.text, c), a.isFunction(l.title.text) && U(l.title.text, c), !G && k.target === "mouse" && k.adjust.mouse && (a(document).bind("mousemove.qtip", function (a) { t = { pageX: a.pageX, pageY: a.pageY, type: "mousemove"} }), G = b), q.reposition(f, arguments[2]), (s.solo = !!i.solo) && a(y, i.solo).not(K).qtip("hide", s)) : (clearTimeout(q.timers.show), delete N.origin, G && !a(y + '[tracking="true"]:visible', i.solo).not(K).length && (a(document).unbind("mousemove.qtip"), G = c), q.blur(f)), i.effect === c || n === c ? (K[h](), u.call(K)) : a.isFunction(i.effect) ? (K.stop(1, 1), i.effect.call(K, q), K.queue("fx", function (a) { u(), a() })) : K.fadeTo(90, e ? 1 : 0, u), e && i.target.trigger("qtip-" + o + "-inactive"); return q }, show: function (a) { return q.toggle(b, a) }, hide: function (a) { return q.toggle(c, a) }, focus: function (b) { if (!q.rendered) return q; var c = a(y), d = parseInt(K[0].style.zIndex, 10), e = r.zindex + c.length, f = a.extend({}, b), g, h; K.hasClass(A) || (h = a.Event("tooltipfocus"), h.originalEvent = f, K.trigger(h, [q, e]), h.isDefaultPrevented() || (d !== e && (c.each(function () { this.style.zIndex > d && (this.style.zIndex = this.style.zIndex - 1) }), c.filter("." + A).qtip("blur", f)), K.addClass(A)[0].style.zIndex = e)); return q }, blur: function (b) { var c = a.extend({}, b), d; K.removeClass(A), d = a.Event("tooltipblur"), d.originalEvent = c, K.trigger(d, [q]); return q }, reposition: function (b, d) { if (!q.rendered || H) return q; H = 1; var e = g.position.target, f = g.position, h = f.my, i = f.at, o = f.adjust, p = o.method.split(" "), r = K.outerWidth(), u = K.outerHeight(), v = 0, w = 0, x = a.Event("tooltipmove"), y = K.css("position") === "fixed", z = f.viewport, A = { left: 0, top: 0 }, B = f.container, C = K[0].offsetWidth > 0, D, E, F; if (a.isArray(e) && e.length === 2) i = { x: k, y: j }, A = { left: e[0], top: e[1] }; else if (e === "mouse" && (b && b.pageX || N.event.pageX)) i = { x: k, y: j }, b = (b && (b.type === "resize" || b.type === "scroll") ? N.event : b && b.pageX && b.type === "mousemove" ? b : t && t.pageX && (o.mouse || !b || !b.pageX) ? { pageX: t.pageX, pageY: t.pageY} : !o.mouse && N.origin && N.origin.pageX && g.show.distance ? N.origin : b) || b || N.event || t || {}, A = { top: b.pageY, left: b.pageX }; else { e === "event" && b && b.target && b.type !== "scroll" && b.type !== "resize" ? N.target = a(b.target) : e !== "event" && (N.target = a(e.jquery ? e : M.target)), e = N.target, e = a(e).eq(0); if (e.length === 0) return q; e[0] === document || e[0] === window ? (v = s.iOS ? window.innerWidth : e.width(), w = s.iOS ? window.innerHeight : e.height(), e[0] === window && (A = { top: (z || e).scrollTop(), left: (z || e).scrollLeft() })) : s.imagemap && e.is("area") ? D = s.imagemap(q, e, i, s.viewport ? p : c) : s.svg && typeof e[0].xmlbase === "string" ? D = s.svg(q, e, i, s.viewport ? p : c) : (v = e.outerWidth(), w = e.outerHeight(), A = s.offset(e, B)), D && (v = D.width, w = D.height, E = D.offset, A = D.position); if (s.iOS > 3.1 && s.iOS < 4.1 || s.iOS >= 4.3 && s.iOS < 4.33 || !s.iOS && y) F = a(window), A.left -= F.scrollLeft(), A.top -= F.scrollTop(); A.left += i.x === m ? v : i.x === n ? v / 2 : 0, A.top += i.y === l ? w : i.y === n ? w / 2 : 0 } A.left += o.x + (h.x === m ? -r : h.x === n ? -r / 2 : 0), A.top += o.y + (h.y === l ? -u : h.y === n ? -u / 2 : 0), s.viewport ? (A.adjusted = s.viewport(q, A, f, v, w, r, u), E && A.adjusted.left && (A.left += E.left), E && A.adjusted.top && (A.top += E.top)) : A.adjusted = { left: 0, top: 0 }, x.originalEvent = a.extend({}, b), K.trigger(x, [q, A, z.elem || z]); if (x.isDefaultPrevented()) return q; delete A.adjusted, d === c || !C || isNaN(A.left) || isNaN(A.top) || e === "mouse" || !a.isFunction(f.effect) ? K.css(A) : a.isFunction(f.effect) && (f.effect.call(K, q, a.extend({}, A)), K.queue(function (b) { a(this).css({ opacity: "", height: "" }), a.browser.msie && this.style.removeAttribute("filter"), b() })), H = 0; return q }, redraw: function () { if (q.rendered < 1 || J) return q; var a = g.position.container, b, c, d, e; J = 1, g.style.height && K.css(i, g.style.height), g.style.width ? K.css(h, g.style.width) : (K.css(h, "").addClass(C), c = K.width() + 1, d = K.css("max-width") || "", e = K.css("min-width") || "", b = (d + e).indexOf("%") > -1 ? a.width() / 100 : 0, d = (d.indexOf("%") > -1 ? b : 1) * parseInt(d, 10) || c, e = (e.indexOf("%") > -1 ? b : 1) * parseInt(e, 10) || 0, c = d + e ? Math.min(Math.max(c, e), d) : c, K.css(h, Math.round(c)).removeClass(C)), J = 0; return q }, disable: function (b) { "boolean" !== typeof b && (b = !K.hasClass(x) && !N.disabled), q.rendered ? (K.toggleClass(x, b), a.attr(K[0], "aria-disabled", b)) : N.disabled = !!b; return q }, enable: function () { return q.disable(c) }, destroy: function () { var c = f[0], d = a.attr(c, F), e = f.data("qtip"); q.destroyed = b, q.rendered && (K.stop(1, 0).remove(), a.each(q.plugins, function () { this.destroy && this.destroy() })), clearTimeout(q.timers.show), clearTimeout(q.timers.hide), X(); if (!e || q === e) a.removeData(c, "qtip"), g.suppress && d && (a.attr(c, "title", d), f.removeAttr(F)), f.removeAttr("aria-describedby"); f.unbind(".qtip-" + o), delete u[q.id]; return f } }) } function I(b) { var e; if (!b || "object" !== typeof b) return c; if (b.metadata === d || "object" !== typeof b.metadata) b.metadata = { type: b.metadata }; if ("content" in b) { if (b.content === d || "object" !== typeof b.content || b.content.jquery) b.content = { text: b.content }; e = b.content.text || c, !a.isFunction(e) && (!e && !e.attr || e.length < 1 || "object" === typeof e && !e.jquery) && (b.content.text = c); if ("title" in b.content) { if (b.content.title === d || "object" !== typeof b.content.title) b.content.title = { text: b.content.title }; e = b.content.title.text || c, !a.isFunction(e) && (!e && !e.attr || e.length < 1 || "object" === typeof e && !e.jquery) && (b.content.title.text = c) } } if ("position" in b) if (b.position === d || "object" !== typeof b.position) b.position = { my: b.position, at: b.position }; if ("show" in b) if (b.show === d || "object" !== typeof b.show) b.show.jquery ? b.show = { target: b.show} : b.show = { event: b.show }; if ("hide" in b) if (b.hide === d || "object" !== typeof b.hide) b.hide.jquery ? b.hide = { target: b.hide} : b.hide = { event: b.hide }; if ("style" in b) if (b.style === d || "object" !== typeof b.style) b.style = { classes: b.style }; a.each(s, function () { this.sanitize && this.sanitize(b) }); return b } function H() { H.history = H.history || [], H.history.push(arguments); if ("object" === typeof console) { var a = console[console.warn ? "warn" : "log"], b = Array.prototype.slice.call(arguments), c; typeof arguments[0] === "string" && (b[0] = "qTip2: " + b[0]), c = a.apply ? a.apply(console, b) : a(b) } } "use strict"; var b = !0, c = !1, d = null, e, f = "x", g = "y", h = "width", i = "height", j = "top", k = "left", l = "bottom", m = "right", n = "center", o = "flip", p = "flipinvert", q = "shift", r, s, t, u = {}, v = "ui-tooltip", w = "ui-widget", x = "ui-state-disabled", y = "div.qtip." + v, z = v + "-default", A = v + "-focus", B = v + "-hover", C = v + "-fluid", D = "-31000px", E = "_replacedByqTip", F = "oldtitle", G; r = a.fn.qtip = function (f, g, h) { var i = ("" + f).toLowerCase(), j = d, k = a.makeArray(arguments).slice(1), l = k[k.length - 1], m = this[0] ? a.data(this[0], "qtip") : d; if (!arguments.length && m || i === "api") return m; if ("string" === typeof f) { this.each(function () { var d = a.data(this, "qtip"); if (!d) return b; l && l.timeStamp && (d.cache.event = l); if (i !== "option" && i !== "options" || !g) d[i] && d[i].apply(d[i], k); else if (a.isPlainObject(g) || h !== e) d.set(g, h); else { j = d.get(g); return c } }); return j !== d ? j : this } if ("object" === typeof f || !arguments.length) { m = I(a.extend(b, {}, f)); return r.bind.call(this, m, l) } }, r.bind = function (d, f) { return this.each(function (g) { function n(b) { function d() { l.render(typeof b === "object" || h.show.ready), i.show.add(i.hide).unbind(k) } if (l.cache.disabled) return c; l.cache.event = a.extend({}, b), l.cache.target = b ? a(b.target) : [e], h.show.delay > 0 ? (clearTimeout(l.timers.show), l.timers.show = setTimeout(d, h.show.delay), j.show !== j.hide && i.hide.bind(j.hide, function () { clearTimeout(l.timers.show) })) : d() } var h, i, j, k, l, m; m = a.isArray(d.id) ? d.id[g] : d.id, m = !m || m === c || m.length < 1 || u[m] ? r.nextid++ : u[m] = m, k = ".qtip-" + m + "-create", l = K.call(this, m, d); if (l === c) return b; h = l.options, a.each(s, function () { this.initialize === "initialize" && this(l) }), i = { show: h.show.target, hide: h.hide.target }, j = { show: a.trim("" + h.show.event).replace(/ /g, k + " ") + k, hide: a.trim("" + h.hide.event).replace(/ /g, k + " ") + k }, /mouse(over|enter)/i.test(j.show) && !/mouse(out|leave)/i.test(j.hide) && (j.hide += " mouseleave" + k), i.show.bind("mousemove" + k, function (a) { t = { pageX: a.pageX, pageY: a.pageY, type: "mousemove" }, l.cache.onTarget = b }), i.show.bind(j.show, n), (h.show.ready || h.prerender) && n(f) }) }, s = r.plugins = { Corner: function (a) { a = ("" + a).replace(/([A-Z])/, " $1").replace(/middle/gi, n).toLowerCase(), this.x = (a.match(/left|right/i) || a.match(/center/) || ["inherit"])[0].toLowerCase(), this.y = (a.match(/top|bottom|center/i) || ["inherit"])[0].toLowerCase(); var b = a.charAt(0); this.precedance = b === "t" || b === "b" ? g : f, this.string = function () { return this.precedance === g ? this.y + this.x : this.x + this.y }, this.abbrev = function () { var a = this.x.substr(0, 1), b = this.y.substr(0, 1); return a === b ? a : this.precedance === g ? b + a : a + b }, this.invertx = function (a) { this.x = this.x === k ? m : this.x === m ? k : a || this.x }, this.inverty = function (a) { this.y = this.y === j ? l : this.y === l ? j : a || this.y }, this.clone = function () { return { x: this.x, y: this.y, precedance: this.precedance, string: this.string, abbrev: this.abbrev, clone: this.clone, invertx: this.invertx, inverty: this.inverty} } }, offset: function (b, c) { function j(a, b) { d.left += b * a.scrollLeft(), d.top += b * a.scrollTop() } var d = b.offset(), e = b.closest("body")[0], f = c, g, h, i; if (f) { do f.css("position") !== "static" && (h = f.position(), d.left -= h.left + (parseInt(f.css("borderLeftWidth"), 10) || 0) + (parseInt(f.css("marginLeft"), 10) || 0), d.top -= h.top + (parseInt(f.css("borderTopWidth"), 10) || 0) + (parseInt(f.css("marginTop"), 10) || 0), !g && (i = f.css("overflow")) !== "hidden" && i !== "visible" && (g = f)); while ((f = a(f[0].offsetParent)).length); g && g[0] !== e && j(g, 1) } return d }, iOS: parseFloat(("" + (/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0, ""])[1]).replace("undefined", "3_2").replace("_", ".").replace("_", "")) || c, fn: { attr: function (b, c) { if (this.length) { var d = this[0], e = "title", f = a.data(d, "qtip"); if (b === e && f && "object" === typeof f && f.options.suppress) { if (arguments.length < 2) return a.attr(d, F); f && f.options.content.attr === e && f.cache.attr && f.set("content.text", c); return this.attr(F, c) } } return a.fn["attr" + E].apply(this, arguments) }, clone: function (b) { var c = a([]), d = "title", e = a.fn["clone" + E].apply(this, arguments); b || e.filter("[" + F + "]").attr("title", function () { return a.attr(this, F) }).removeAttr(F); return e } } }, a.each(s.fn, function (c, d) { if (!d || a.fn[c + E]) return b; var e = a.fn[c + E] = a.fn[c]; a.fn[c] = function () { return d.apply(this, arguments) || e.apply(this, arguments) } }), a.ui || (a["cleanData" + E] = a.cleanData, a.cleanData = function (b) { for (var c = 0, d; (d = b[c]) !== e; c++) try { a(d).triggerHandler("removeqtip") } catch (f) { } a["cleanData" + E](b) }), r.version = "nightly", r.nextid = 0, r.inactiveEvents = "click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "), r.zindex = 15e3, r.defaults = { prerender: c, id: c, overwrite: b, suppress: b, content: { text: b, attr: "title", title: { text: c, button: c} }, position: { my: "top left", at: "bottom right", target: c, container: c, viewport: c, adjust: { x: 0, y: 0, mouse: b, resize: b, method: "flip flip" }, effect: function (b, d, e) { a(this).animate(d, { duration: 200, queue: c }) } }, show: { target: c, event: "mouseenter", effect: b, delay: 90, solo: c, ready: c, autofocus: c }, hide: { target: c, event: "mouseleave", effect: b, delay: 0, fixed: c, inactive: c, leave: "window", distance: c }, style: { classes: "", widget: c, width: c, height: c, def: b }, events: { render: d, move: d, show: d, hide: d, toggle: d, visible: d, hidden: d, focus: d, blur: d} }, s.ajax = function (a) { var b = a.plugins.ajax; return "object" === typeof b ? b : a.plugins.ajax = new L(a) }, s.ajax.initialize = "render", s.ajax.sanitize = function (a) { var b = a.content, c; b && "ajax" in b && (c = b.ajax, typeof c !== "object" && (c = a.content.ajax = { url: c }), "boolean" !== typeof c.once && c.once && (c.once = !!c.once)) }, a.extend(b, r.defaults, { content: { ajax: { loading: b, once: b}} }), s.imagemap = function (b, c, d, e) { function v(a, b, c) { var d = 0, e = 1, f = 1, g = 0, h = 0, i = a.width, o = a.height; while (i > 0 && o > 0 && e > 0 && f > 0) { i = Math.floor(i / 2), o = Math.floor(o / 2), c.x === k ? e = i : c.x === m ? e = a.width - i : e += Math.floor(i / 2), c.y === j ? f = o : c.y === l ? f = a.height - o : f += Math.floor(o / 2), d = b.length; while (d--) { if (b.length < 2) break; g = b[d][0] - a.position.left, h = b[d][1] - a.position.top, (c.x === k && g >= e || c.x === m && g <= e || c.x === n && (g < e || g > a.width - e) || c.y === j && h >= f || c.y === l && h <= f || c.y === n && (h < f || h > a.height - f)) && b.splice(d, 1) } } return { left: b[0][0], top: b[0][1]} } c.jquery || (c = a(c)); var f = b.cache.areas = {}, g = (c[0].shape || c.attr("shape")).toLowerCase(), h = c[0].coords || c.attr("coords"), i = h.split(","), o = [], p = a('img[usemap="#' + c.parent("map").attr("name") + '"]'), q = p.offset(), r = { width: 0, height: 0, position: { top: 1e10, right: 0, bottom: 0, left: 1e10} }, s = 0, t = 0, u; q.left += Math.ceil((p.outerWidth() - p.width()) / 2), q.top += Math.ceil((p.outerHeight() - p.height()) / 2); if (g === "poly") { s = i.length; while (s--) t = [parseInt(i[--s], 10), parseInt(i[s + 1], 10)], t[0] > r.position.right && (r.position.right = t[0]), t[0] < r.position.left && (r.position.left = t[0]), t[1] > r.position.bottom && (r.position.bottom = t[1]), t[1] < r.position.top && (r.position.top = t[1]), o.push(t) } else { s = -1; while (s++ < i) o.push(parseInt(i[s], 10)) } switch (g) { case "rect": r = { width: Math.abs(o[2] - o[0]), height: Math.abs(o[3] - o[1]), position: { left: Math.min(o[0], o[2]), top: Math.min(o[1], o[3])} }; break; case "circle": r = { width: o[2] + 2, height: o[2] + 2, position: { left: o[0], top: o[1]} }; break; case "poly": r.width = Math.abs(r.position.right - r.position.left), r.height = Math.abs(r.position.bottom - r.position.top), d.abbrev() === "c" ? r.position = { left: r.position.left + r.width / 2, top: r.position.top + r.height / 2} : (f[d + h] || (r.position = v(r, o.slice(), d), e && (e[0] === "flip" || e[1] === "flip") && (r.offset = v(r, o.slice(), { x: d.x === k ? m : d.x === m ? k : n, y: d.y === j ? l : d.y === l ? j : n }), r.offset.left -= r.position.left, r.offset.top -= r.position.top), f[d + h] = r), r = f[d + h]), r.width = r.height = 0 } r.position.left += q.left, r.position.top += q.top; return r }, s.tip = function (a) { var b = a.plugins.tip; return "object" === typeof b ? b : a.plugins.tip = new N(a) }, s.tip.initialize = "render", s.tip.sanitize = function (a) { var c = a.style, d; c && "tip" in c && (d = a.style.tip, typeof d !== "object" && (a.style.tip = { corner: d }), /string|boolean/i.test(typeof d.corner) || (d.corner = b), typeof d.width !== "number" && delete d.width, typeof d.height !== "number" && delete d.height, typeof d.border !== "number" && d.border !== b && delete d.border, typeof d.offset !== "number" && delete d.offset) }, a.extend(b, r.defaults, { style: { tip: { corner: b, mimic: c, width: 6, height: 6, border: b, offset: 0}} }), s.svg = function (b, c, d, e) { var f = a(document), g = c[0], h = { width: 0, height: 0, position: { top: 1e10, left: 1e10} }, i, j, k, l, m; while (!g.getBBox) g = g.parentNode; if (g.getBBox && g.parentNode) { i = g.getBBox(), j = g.getScreenCTM(), k = g.farthestViewportElement || g; if (!k.createSVGPoint) return h; l = k.createSVGPoint(), l.x = i.x, l.y = i.y, m = l.matrixTransform(j), h.position.left = m.x, h.position.top = m.y, l.x += i.width, l.y += i.height, m = l.matrixTransform(j), h.width = m.x - h.position.left, h.height = m.y - h.position.top, h.position.left += f.scrollLeft(), h.position.top += f.scrollTop() } return h }, s.modal = function (a) { var b = a.plugins.modal; return "object" === typeof b ? b : a.plugins.modal = new O(a) }, s.modal.initialize = "render", s.modal.sanitize = function (a) { a.show && (typeof a.show.modal !== "object" ? a.show.modal = { on: !!a.show.modal} : typeof a.show.modal.on === "undefined" && (a.show.modal.on = b)) }, s.modal.zindex = r.zindex + 1e3, s.modal.focusable = ["a[href]", "area[href]", "input", "select", "textarea", "button", "iframe", "object", "embed", "[tabindex]", "[contenteditable]"], a.extend(b, r.defaults, { show: { modal: { on: c, effect: b, blur: b, stealfocus: b, escape: b}} }), s.bgiframe = function (b) { var d = a.browser, e = b.plugins.bgiframe; if (a("select, object").length < 1 || (!d.msie || ("" + d.version).charAt(0) !== "6")) return c; return "object" === typeof e ? e : b.plugins.bgiframe = new P(b) }, s.bgiframe.initialize = "render" })